package com.kelp.codetoolkit.enums

/**
 * @author: liuyuebai
 * @date: 2024/8/12 19:36
 * @description:
 */
enum class JavaTemplateInfoEnum(val templateKey:String, val templatePath:String, val packageName:String, val templateSuffix:String) {

    MYBATIS_PLUS_ENTITY("MyBatis-Plus","/template/mybatis-plus/entity.java.vm","entity",".java"),
    MYBATIS_PLUS_DAO("MyBatis-Plus","/template/mybatis-plus/dao.java.vm","dao","Mapper.java"),
    MYBATIS_PLUS_SERVICE("MyBatis-Plus","/template/mybatis-plus/service.java.vm","service","Service.java"),
    MYBATIS_PLUS_SERVICE_IMPL("MyBatis-Plus","/template/mybatis-plus/serviceImpl.java.vm","service/impl","ServiceImpl.java"),

    PROVIDER("Dubbo","/template/dubbo/provider.java.vm","provider","Provider.java"),
    PROVIDER_IMPL("Dubbo","/template/dubbo/providerImpl.java.vm","provider","ProviderImpl.java"),

    CONTROLLER("Controller","/template/controller/controller.java.vm","controller","Controller.java"),

    MYBATIS_ENTITY("MyBatis","/template/mybatis/entity.java.vm","entity",".java"),
    MYBATIS_DAO("MyBatis","/template/mybatis/dao.java.vm","dao","Mapper.java"),
    MYBATIS_SERVICE("MyBatis","/template/mybatis/service.java.vm","service","Service.java"),
    MYBATIS_SERVICE_IMPL("MyBatis","/template/mybatis/serviceImpl.java.vm","service/impl","ServiceImpl.java"),


    ;

    companion object{

        fun get(templateKey: String):MutableList<JavaTemplateInfoEnum>{
            val result = mutableListOf<JavaTemplateInfoEnum>()
            for (templatePathEnum in values()){
                if (templatePathEnum.templateKey == templateKey){
                    result.add(templatePathEnum)
                }
            }
            return result
        }

    }


}